<?php $category_id = (!isset($topic) or $topic==null or $topic->getCategoryId()==0)?$sf_request->getParameter('category_id'):$topic->getCategoryId(); ?>

<div id="sfForumAction">
    <div class='myforummenu'><a href="<?php echo url_for('sfForumTopic/new?category_id='.$sf_request->getParameter('category_id')) ?>"><img src='/images/new_page.png'>Новая тема</a></div>
    <div class='myforummenu'><a href="<?php echo url_for('sfForumCategory/index') ?>"><img src='/images/folder_full.png'>Список разделов</a></div>
    <div class='myforummenu'><a href="<?php echo url_for('sfForumTopic/index?category_id='.$category_id) ?>"><img src='/images/pages.png' />Список тем</a></div>
    <?php if($sf_user->isAuthenticated()): ?>
        <div class='myforummenu'><a href="<?php echo url_for('myaccount/index') ?>"><img src='/images/edit_profile.png' />Мой профайл</a></div>
        <?php if (!empty($topic) and $sf_user->getGuardUser()->getId()==$topic->getAuthor()): ?>
            <?php echo link_to($topic->getName(),'sfForumCategory/edit?id='.$topic->getId()); ?>
        <?php endif; ?>
    <?php endif; ?>
    <?php if (!$sf_user->isAuthenticated()): ?>
        <?php echo '<div class="myforummenu">'. link_to('<img src="/images/accept.png" />Вход','@sf_guard_signin').'</div>' ?> 
    <?php else: ?>
        <?php echo '<div class="myforummenu">'. link_to('<img src="/images/block.png" />Выход', '@sf_guard_signout').'</div>' ?>
    <?php endif; ?>
    <div class='forumsearch'>
    <input class="searchtext" type="text" name="sfForumSearch" />
    <input class="searchbutton"  type="submit" name="sfForumSearchSubmit" value="Поиск" />
    </div>
</div>